home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / TEMP / GNU / bison / HowPrecede < prev    next >
Text File  |  1995-06-28  |  1KB  |  25 lines

  1. How Precedence
  2. Previous: <Precedence Examples=>Precedencg> * Next: <Contextual Precedence=>Contextual> * Up: <Precedence=>Precedencf>
  3.  
  4. #Wrap on
  5. {fH4}How Precedence Works{f}
  6.  
  7. The first effect of the precedence declarations is to assign precedence
  8. levels to the terminal symbols declared.  The second effect is to assign
  9. precedence levels to certain rules: each rule gets its precedence from the
  10. last terminal symbol mentioned in the components.  (You can also specify
  11. explicitly the precedence of a rule.  \*Note <Contextual Precedence=>Contextual>: Context-Dependent Precedence.)
  12.  
  13. Finally, the resolution of conflicts works by comparing the
  14. precedence of the rule being considered with that of the
  15. look-ahead token.  If the token's precedence is higher, the
  16. choice is to shift.  If the rule's precedence is higher, the
  17. choice is to reduce.  If they have equal precedence, the choice
  18. is made based on the associativity of that precedence level.  The
  19. verbose output file made by {fEmphasis}-v{f} (\*Note <Invocation=>Invocation>: Invoking Bison) says
  20. how each conflict was resolved.
  21.  
  22. Not all rules and not all tokens have precedence.  If either the rule or
  23. the look-ahead token has no precedence, then the default is to shift.
  24.  
  25.